<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let func = x => x + 1;
        console.log(func(11));

        class Person {
            // 在属性前面加上 # 代表私有 但是它并不是属性 而是名字 也就是属性名变成了 #属性名
            #name;
            #pid;

            get name() {
                return this.#name;
            }
            get pid() {
                return this.#pid;
            }
            set name(name) {
                this.#name = name;
            }
            set pid(pid) {
                this.#pid = pid;
            }

            constructor (pid, name) {
                this.#pid = pid;
                this.#name = name;
            }

            eat(food) {
                console.log(`${this.#name}正在吃${food}`);
            }
        }

        let person = new Person(114514, "野兽前辈");
        person.eat("昏睡红茶");
    </script>
</head>
<body>
    
</body>
</html>